<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<!--<![endif]-->
<!-- BEGIN HEAD -->
<!-- BEGIN BODY -->
<style type="text/css">
	.wraping{
		background: #fff;
	}
	.table_btn_box{
		margin-bottom: 5px;
		float: left;
	}
	.modal-content .modal-footer button.btn-primary {
		margin-top:0; 
		margin-bottom:0;
	}
		.btn-div{
		float: left;top: 10px;margin-bottom: 5px;padding-left: 10px;
	}
			.row{
			margin: 0;
		}
		.radio-list{
			padding-top: 3px;
		}
		.sudden{
			margin-top:10px;
		}
</style>
<body class="page-header-fixed">
			<div class="btn-div">
				<a class="btn blue" href="javascript:;"  data-target="#factoryModel" 
					data-toggle="modal" ng-click="addFactory();">
					<i class="fa fa-plus"></i>
						新增
				</a>
			</div>
			<table class="table table-striped table-bordered table-hover" id="table_1">
			<thead>
				<tr>
					<th>厂商ID</th>
					<th>是否运营商</th>
					<th>厂商名称</th>
					<th>品牌</th>
					<th>厂家地址</th>
					<th>审核状态</th>
					<th>是否使用</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr class="odd gradeX" ng-repeat="factory in allFactoryList  track by $index" pg-loaded="{{$last}}" target-table="table_1">
					<td>
						<span ng-bind="factory.factory_id"></span>
					</td>
					<td>
						<span ng-if="!!factory.oper_merchant_id" ng-bind="factory.oper_merchant_id"></span>
						<span ng-if="!!!factory.oper_merchant_id">否</span>
					</td>
					<td>
						<span ng-bind="factory.factory_name | commonSubString"></span>
					</td>
					<td>
						<span ng-bind="factory.brand | commonSubString"></span>
					</td>
					
					<td>
						<span ng-bind="factory.address | commonSubString"></span>
					</td>
					<td>
						<span ng-bind="factory.review_state  | getValueInStaticFilter : 'reviewStateArray'"></span>
					</td>
					<td>
						<span ng-bind="factory.valid_flag  | getValueInStaticFilter : 'validArray'"></span>
					</td>
					<td>
						<a class="btn" href="javascript:;"  data-target="#factoryModel" 
						data-toggle="modal" ng-click="updateFactory(factory);">
							修改
						</a>
						<a class="btn" href="javascript:;"  data-target="#deivceTypeList" 
						data-toggle="modal" ng-click="deivceTypeManage(factory);">
							设备类型管理
						</a>
					</td>
				</tr>
			</tbody>
			</table>
			<tm-pagination conf="paginationConf"></tm-pagination>
			<div id="factoryModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
				<div class="modal-dialog">
					<div class="modal-content">
					 <form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="validReset();">×</button>
							<h4 class="modal-title" ng-bind="titleText">厂商新增/修改</h4>
						</div>
						<div class="modal-body form">
							<div class="form-group">
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>厂商名称</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control validInput" ng-model="selectedFactory.factory_name" required="" ng-maxlength='50'
											 placeholder="请输入字母、数字、中文和下划线组合" name="factory_name" ng-pattern="/^[\u4e00-\u9fa5\w]*$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">品牌</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedFactory.brand" ng-maxlength="20"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">地址</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedFactory.address" ng-maxlength="100"/>
										</div>
									</div>
								</div>
<!-- 								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>登录账号</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control validInput" ng-model="selectedFactory.fac_login_name" required="" name="fac_login_name" ng-maxlength="50"/>
										</div>
									</div>
								</div> -->
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>登录密码</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="password" class="form-control validInput"
											ng-model="selectedFactory.fac_password"  
											name="fac_password" required="" ng-pattern="/^\d{8}$/"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>重复密码</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="password" class="form-control validInput" 
											ng-model="selectedFactory.repeatPassword" 
											name="repeatPassword" 
											w5c-repeat="fac_password" required="" ng-pattern="/^\d{8}$/"/>
										</div>
									</div>
								</div>
								<div class="row" ng-if="'insert'!=modifyType">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>是否启用</label>
									<div class="col-md-8">
										<div class="radio-list">
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedFactory.valid_flag" type="radio"  value="1" 
												ng-selected="selectedFactory.valid_flag==1">
													启用
											</label>
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedFactory.valid_flag" type="radio"  value="0" 
												ng-selected="selectedFactory.valid_flag==0">
													停用
											</label>
										</div>
									</div>
								</div>
							</div>
						</div>
						
						<div class="modal-footer">
							<button type="button" class="btn btn-danger" data-dismiss="modal" onclick="validReset();"><i class="fa fa-times"></i>关闭</button>
							<button type="button" class="btn btn-primary" 
							w5c-form-submit="modifyFactory();"><i class="fa fa-check"></i>保存</button>
						</div>
						</form>
					</div>
				</div>
			</div>
			

			<div id="deivceTypeList" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false" >
				<div class="modal-dialog" style="width:1000px">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-hidden="true">×</button>
							<h4 class="modal-title">厂商【{{selectedFactory.factory_name}}】所属设备类型管理</h4>
						</div>

						<div class="modal-body form">

							<div class="form-group">
								<div class="table_btn_box">
									<a class="btn blue" href="javascript:;"  data-target="#deivceTypeModel" 
										data-toggle="modal" ng-click="addDeivceType();">
										<i class="fa fa-plus"></i>
											新增
									</a>
								</div>
								<table class="table table-striped table-bordered table-hover"
									id="table_2">
									<thead>
										<tr>
											<th>电流类型</th>
											<th>一级类型</th>
											<th>二级类型</th>
											<th>充电类型</th>
											<th>接口类型</th>
											<th>连接类型</th>
											<th>编号</th>
											<th>名称</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<tr class="odd gradeX"
											ng-repeat="deviceType in deviceTypeList  track by $index"
											on-loaded="{{$last}}" target-table="table_2">
											<td><span
												ng-bind="deviceType.charger_type | getValueInStaticFilter : 'chargerTypeArray'"></span>
											</td>
											<td><span
												ng-bind="deviceType.dev_type1 | getValueInStaticFilter : 'devType1Array'"></span>
											</td>
											<td><span
												ng-bind="deviceType.dev_type2 | getValueInStaticFilter : 'devType2Array'"></span>
											</td>
											<td><span
												ng-bind="deviceType.dev_charge_type | getValueInStaticFilter : 'chargeTypeArray'"></span>
											</td>
											<td><span
												ng-bind="deviceType.charge_port_type | getValueInStaticFilter : 'portTypeArray'"></span>
											</td>
											<td><span
												ng-bind="deviceType.connect_type | getValueInStaticFilter : 'connectTypeArray'"></span>
											</td>
											<td><span
												ng-bind="deviceType.device_code"></span>
											</td>
											<td><span
												ng-bind="deviceType.device_name"></span>
											</td>
											<td>
												<a class="btn" href="javascript:;"  data-target="#deivceTypeModel" 
												data-toggle="modal" ng-click="updateDeivceType(deviceType);">
													修改
												</a>
												<a class="btn" href="javascript:;" ng-click="deleteDeivceType(deviceType);">
													删除
												</a>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-danger" data-dismiss="modal">
								<i class="fa fa-times"></i>关闭
							</button>
						</div>
					</div>
				</div>
			</div>

			<div id="deivceTypeModel" class="modal fade" role="dialog" aria-hidden="true" data-backdrop="false">
				<div class="modal-dialog">
					<div class="modal-content">						
					<form class="w5c-form demo-form" role="form" w5c-form-validate="vm.validateOptions" novalidate name="validateForm">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="validateForm.reset()">×</button>
							<h4 class="modal-title">设备类型新增/修改</h4>
						</div>

						<div class="modal-body form">
							<div class="form-group">
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>电流类型</label>
									<div class="col-sm-8">
										<div class="input-group">
											<select class="form-control" ng-model="selectedDeivceType.charger_type" name="charger_type" required="">
												<option value="">请选择</option>
												<option value="1" selected="selected">直流</option>
												<option value="2">交流</option>
												<option value="3">混合</option>
											</select>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>一级类型</label>
									<div class="col-sm-8">
										<div class="input-group" ng-model="selectedDeivceType.dev_type1">
											<select class="form-control" ng-model="subset1" name="subset1" required="">
												<option value="">请选择</option>
												<option value="0">壁挂式</option>
												<option value="1" selected="selected">立式</option>
												<option value="2">内嵌式</option>
												<option value="F">其它</option>
											</select>
											<select class="form-control sudden" ng-model="subset2" name="subset2" required="">
												<option value="">请选择</option>
												<option value="0" selected="selected">单枪单充</option>
												<option value="1">双枪双充</option>
												<option value="2">双枪单充</option>
											</select>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>二级类型</label>
									<div class="col-sm-8">
										<div class="input-group">
											<select class="form-control" ng-model="selectedDeivceType.dev_type2" name="dev_type2" required="">
												<option value="">请选择</option>
												<option value="00">小于等于3.5KW</option>
												<option value="01">大于3.5KW小于等于8KW</option>
												<option value="02">大于8KW小于等于100KW</option>
												<option value="03 ">大于100KW</option>
											</select>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>充电类型</label>
									<div class="col-sm-8">
										<div class="input-group">
											<select class="form-control" ng-model="selectedDeivceType.dev_charge_type" name="dev_charge_type" required="">
												<option value="">请选择</option>
												<option value="1">慢充</option>
												<option value="2">快充</option>
												<option value="3">未知</option>
											</select>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>接口类型</label>
									<div class="col-sm-8">
										<div class="input-group">
											<select class="form-control" ng-model="selectedDeivceType.charge_port_type"  name="charge_port_type" required="">
												<option value="">请选择</option>
												<option value="1">国标</option>
												<option value="2">特斯拉</option>
												<option value="3">ABB</option>
												<option value="3">其他</option>
											</select>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>连接类型</label>
									<div class="col-sm-8">
										<div class="input-group">
											<select class="form-control" ng-model="selectedDeivceType.connect_type" name="connect_type" required="">
												<option value="">请选择</option>
												<option value="1">在线桩（GPRS桩）</option>
												<option value="2">离线桩（蓝牙桩）</option>
											</select>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color">* </span>编号</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.device_code" required="" name="device_code" ng-maxlength="50"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">名称</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.device_name" name="device_name"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">最高充电电压</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.charge_v_max" name="charge_v_max" ng-pattern="/^\d+(\.\d{0,2})?$/" maxlength="8"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">最大充电电流</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.charge_a_max" name="charge_a_max" ng-pattern="/^\d+(\.\d{0,2})?$/" maxlength="8"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">最大充电功率</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.charge_p_max" name="charge_p_max" ng-pattern="/^\d+(\.\d{0,2})?$/" maxlength="8"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">单体保护电压</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.bms_protect_v" name="bms_protect_v" ng-pattern="/^\d+(\.\d{0,2})?$/" maxlength="8"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">充电保护温度</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.bms_protect_a"
											name="bms_protect_a" ng-pattern="/^\d+(\.\d{0,2})?$/" maxlength="8"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right">固件软件版本号</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.software_version"  name="software_version"/>
										</div>
									</div>
								</div>
								<div class="row">
									<label class="col-sm-3 control-label text-right"><span class="star-color"></span>设备扩展属性</label>
									<div class="col-sm-8">
										<div class="input-group">
											<input type="text" class="form-control" ng-model="selectedDeivceType.dev_attribute"  name="dev_attribute"/>
										</div>
									</div>
								</div>
								<div class="row" ng-if="'insert'!=modifyType">
									<label class="col-sm-3 control-label text-right">是否启用</label>
									<div class="col-md-8">
										<div class="radio-list">
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedDeivceType.valid_flag" type="radio"  value="1" 
												ng-selected="selectedDeivceType.valid_flag==1">
													启用
											</label>
											<label  class="radio-inline col-md-4" style="margin:0px;padding: 0px">
												<input ng-model="selectedDeivceType.valid_flag" type="radio"  value="0" 
												ng-selected="selectedDeivceType.valid_flag==0">
													停用
											</label>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button ng-click="validateForm.reset()" type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-times"></i>关闭</button>
							<button type="button" class="btn btn-primary" w5c-form-submit="modifyDeivceType();"><i class="fa fa-check"></i>保存</button>
						</div>
						</form>
					</div>
				</div>
			</div>
</body>
</html>
